<template>

	<view>
		<view v-if="StudentRecordingDatas.code==1">
			<nodata-view></nodata-view>
		</view>
		<view v-if="StudentRecordingDatas.code==403">
			<nodata-view></nodata-view>
		</view>
		<view v-else-if="StudentRecordingDatas.code==0">
			<nodata-view></nodata-view>
		</view>
		<view v-else-if="StudentRecordingDatas.code==2">
			<nodata-view></nodata-view>
		</view>
		<view v-else>
			<view v-if="StudentRecordingDatas==''">
				<nodata-view></nodata-view>
			</view>
			<view v-for="(item,index) in StudentRecordingDatas" :key="index">
				<tabList01Item :StudentRecordingData="item" @aLoad="aLoad"></tabList01Item>
			</view>
		</view>
	</view>

</template>

<script>
	import {
		// getTest,
		getStudentRecordingById
	} from '@/api/status/service.js';
	import nodataView from '@/components/nodataView/nodataView.vue'
	import tabList01Item from "./tabList01Item.vue"
	export default {
		components: {
			tabList01Item,
			nodataView
		},
		data() {
			return {
				Stuid: 4,
				StudentRecordingDatas: '',
				sonRefresh: true,
				menuKey: true
			}
		},

		mounted() {
			// StudentRecordingDatas: '',
		},
		onShow() {
			console.log("onShow")
			this.Stuid = uni.getStorageSync("Stuid");
			this.loadData(this.Stuid);
		},
		beforeMount() {
			console.group('beforeMount 组件挂载之前状态===============》');

		},
		created() {
			//id怎么来?
			this.Stuid = uni.getStorageSync("Stuid");

			this.loadData(this.Stuid);
			console.log("created")
		},
		beforeUpdate() {
			console.log("updata ")
			// this.Stuid = uni.getStorageSync("Stuid");
			// if (this.menuKey == true) {
			// 	this.loadData(this.Stuid);
			// 	this.menuKey = false;
			// }
		},
		updated() {
			console.log("updata ")
		},
		methods: {
			aLoad() {
				this.Stuid = uni.getStorageSync("Stuid");
				this.loadData(this.Stuid);
				console.log("aLoad")
			},
			loadData(id) {
				getStudentRecordingById(id)
					.then(res => {
						this.StudentRecordingDatas = res.data;
						console.log(res);
						console.log(this.StudentRecordingDatas)
					}).catch(res => {
						console.log(res)
					})
			}
		}
	}
</script>

<style>
</style>
